<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .pagination .page{
            display: inline-block;
            padding: 5px;
            background-color: peachpuff;
            margin: 5px;
        }
        .pagination .page.active{
            background-color: brown;
            color: white;
        }
    </style>
</head>
<body>
<ul>
    {% for item in li %}
    <li>{{ item }}</li>
    {% endfor %}
</ul>

<div class="pagination">
    {{ page_str }}
</div>

<div>
    <label for="male">每页显示数量</label><select name="s" id="male" onchange="changePageSize(this)">
        <option value="10">10</option>
        <option value="30">30</option>
        <option value="50">50</option>
        <option value="100">100</option>
    </select>
</div>

<script src="https://cdn.staticfile.org/jquery/3.4.0/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
<script>
    $(function (){
        const v= $.cookie('per_page_count');
        $('#male').val(v)
    })

    function changePageSize(ths){
        const v = $(ths).val();
        console.log(v);
        $.cookie('per_page_count',v);
        location.reload();
    }

</script>

</body>
</html>